
#pragma once

#include "config.hpp"

template <typename T>
class IteratorsTest : public ::testing::Test 
{};

TYPED_TEST_CASE_P(IteratorsTest);

TYPED_TEST_P(IteratorsTest, BeginEnd_Empty)
{
    using TB = TYPE_PARAM<>::begin;
    using TE = TYPE_PARAM<>::end;

    EXPECT_SAME( TB, TE );
}

TYPED_TEST_P(IteratorsTest, Begin_OneElement)
{
    using T1 = TYPE_PARAM<int>::begin::type;
    using T2 = TYPE_PARAM<long>::begin::type;
    using T3 = TYPE_PARAM<char>::begin::type;

    EXPECT_SAME( int, T1 );
    EXPECT_SAME( long, T2 );
    EXPECT_SAME( char, T3 );
}

TYPED_TEST_P(IteratorsTest, Begin)
{
    using T1 = TYPE_PARAM<int, long>::begin::type;
    using T2 = TYPE_PARAM<long, int, char>::begin::type;
    using T3 = TYPE_PARAM<char, int, int>::begin::type;

    EXPECT_SAME( int, T1 );
    EXPECT_SAME( long, T2 );
    EXPECT_SAME( char, T3 );
}

TYPED_TEST_P(IteratorsTest, End_OneElement)
{
    using T1 = TYPE_PARAM<int>::end::prev::type;
    using T2 = TYPE_PARAM<long>::end::prev::type;
    using T3 = TYPE_PARAM<char>::end::prev::type;

    EXPECT_SAME( int, T1 );
    EXPECT_SAME( long, T2 );
    EXPECT_SAME( char, T3 );
}

TYPED_TEST_P(IteratorsTest, End)
{
    using T1 = TYPE_PARAM<int, long>::end::prev::type;
    using T2 = TYPE_PARAM<long, int, char>::end::prev::type;
    using T3 = TYPE_PARAM<char, int, int>::end::prev::type;

    EXPECT_SAME( long, T1 );
    EXPECT_SAME( char, T2 );
    EXPECT_SAME( int, T3 );
}

REGISTER_TYPED_TEST_CASE_P(IteratorsTest, BeginEnd_Empty,
                                          Begin_OneElement, Begin,
                                          End_OneElement, End);
